package day17;

import java.util.Locale;
import java.util.Scanner;

/**
 * 统计字符串中某个字符的出现次数
 *
 * @author wileda
 * @date 2023/03/24  8:12
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
         while (scanner.hasNext()){
             String str = scanner.nextLine().toLowerCase();
             char ch =  scanner.next().toLowerCase().charAt(0);
             int counts = countWord(str,ch);
             System.out.println(counts);
         }
    }

    private static int countWord(String str, char ch) {
        int count = 0;
        int index = 0;

        while(index < str.length()){
            if(str.charAt(index) == ch){
                count++;
            }
            index++;
        }
        return count;
    }
}
